package com.etoak.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.etoak.entity.Area;
import com.etoak.mapper.AreaMapper;
import com.etoak.service.AreaService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author et2108
 * @since 2021-12-11
 */
@Service
public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements AreaService {

    @Autowired
    AreaMapper areaMapper;

    @Override
    public List<Area> queryList(int parentId) {
        QueryWrapper<Area> queryWrapper = new QueryWrapper<>();
        queryWrapper.select("id","name").eq("parent_id",parentId);
        return areaMapper.selectList(queryWrapper);
    }
}
